package com.dly.blog.controller;

import com.dly.blog.annotation.IgnoreAccess;
import com.dly.blog.annotation.OpLog;
import com.dly.blog.domain.OpLogEntity;
import com.dly.blog.domain.ro.OpLogRO;
import com.dly.blog.domain.ro.PageRO;
import com.dly.blog.domain.vo.PageVO;
import com.dly.blog.inteface.LogStorageService;
import com.dly.blog.msg.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: DaiLiYu
 * @Date: 2023/7/21 10:28
 */
@RestController
@Tag(name = "日志相关接口")
@IgnoreAccess
@RequestMapping("log")
@AllArgsConstructor
public class LogController extends BaseController{

    private final LogStorageService logStorageService;

    @Operation(summary = "获取日志分页接口")
    @PostMapping("/getPage")
    public ResponseEntity<R<PageVO<OpLogEntity>>> getLogPage(@RequestBody OpLogRO pageRO){
        return operate(()->this.successDate(logStorageService.getPageLog(pageRO)));
    }
}
